/*
 * Copyright 2005-2013 evolution.com. All rights reserved.
 */
package com.evolution.warlock.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
/**
 * Entity - 民族
 * 
 * @author EVOLUTION Team
 * @version 1.0
 */
@Entity
@Table(name = "ev_static_religion")
@SequenceGenerator(name = "sequenceGenerator", sequenceName = "ev_static_religion_sequence")
public class Religion extends BaseEntity {

   private static final long serialVersionUID = 6406972370471330213L;
	
   /** 宗教名 */
   private String name;
   
   /** 排序 */
   private String periodCd;
   
   /** 犯罪人员 */
   private Set<CriminalMember> members = new HashSet<CriminalMember>(); 

  /**
    * 
    */
   @NotEmpty
   @Length(max = 20)
   @Column(nullable = false)
   public String getName() {
	   return name;
   }
   
   /**
    * 
    */
   public void setName(String name) {
	   this.name = name;
   }
   
   @Length(max = 20)
   public String getPeriodCd() {
	 return periodCd;
   } 

   public void setPeriodCd(String periodCd) {
	 this.periodCd = periodCd;
   }
   
   
   @OneToMany(mappedBy = "religion", fetch = FetchType.LAZY)
   public Set<CriminalMember> getMembers() {
	   return members;
   }

   public void setMembers(Set<CriminalMember> members) {
	   this.members = members;
   } 
   
   
}
